package com.zlx.xbhy.controller;

import com.zlx.xbhy.entity.Result;
import com.zlx.xbhy.service.ArticleService;
import com.zlx.xbhy.service.MeetingService;
import com.zlx.xbhy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.common.Mapper;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName HomeController
 * @Description TODO
 * @Author Edward
 * @Date 2020/11/24 21:50
 */
@RestController
@RequestMapping("home")
public class HomeController {
    @Autowired
    private UserService userService;
    @Autowired
    private MeetingService meetingService;
    @Autowired
    private ArticleService articleService;

    @GetMapping("getCreateBy7Day")
    public Result getCreateBy7Day(){
        Map<String,Object> map = new HashMap<>();
        map.put("user",userService.countNew());
        map.put("meeting",meetingService.countNew());
        map.put("article",articleService.countNew());
        return new Result(map);
    }
}
